package cn.org.guhao.practice.labs.trace;

import cn.org.guhao.practice.labs.domain.vo.User;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

/**
 * TraceIns
 *
 * @author guhao
 * @since 2020/7/29
 */
@Service
public class TraceIns {

  @Trace
  @Tag(key = "tag1", value = "arg[0]")
  @Tag(key = "tag2", value = "arg[1]")
  @Tag(key = "username", value = "returnedObj.username")
  @Tag(key = "age", value = "returnedObj.age")
  public User helloBoy(String username, Integer age){
    User boy = new User();
    boy.setAge(age + 1);
    boy.setUsername(username.concat("_suffix"));
    return boy;
  }

}
